<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base target="_self">
    <title>费用追加</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="费用,追加">
	<meta http-equiv="description" content="This is my page">

	<style type="text/css">
	.indexDiv
	{
		width:500px;
		height:23px;
		display:inline;
		float:left;
		border-style:solid;
		border-width:1px;
		border-color:lightblue;
		padding: 2px 2px 2px 2px;
		margin:2px 6px 8px 2px;
	}
	</style>

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'费用追加'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
    		<s:hidden name="tuition.id" id="tuitionId"></s:hidden>
    		<s:hidden name="ct.id" id="tempId"></s:hidden>
    		
    		<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
    			<tr bgcolor="#FFFFFF">
    				<td width="20%" align="right" class="label">
    					指标：
    					<br>
   						<font color="red" style="font-size:12px">(￥为每个月的费用)</font>
    				</td>
    				<td width="80%" align="left" colspan="3" id="indexTd">
    					<jsp:include page="/jsp/login/business/charge/template/chargeTemp.jsp"></jsp:include>
    				</td>
    			</tr>
    		</table>
    		
    		<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<input type="button" value="追加" class="btn" onclick="addTuitionDetail()" />
    				</td>
    			</tr>
    		</table>
    		
    	</s:form>
    </center>
    
    <script type="text/javascript">
    $(function(){
    	//从chargeTemp.jsp来
    	tempInit();
    	$('BODY').focus();
    });
    
    function addTuitionDetail()
    {
    	checkTotalAmount();
    	var indexAddDiv = $('#indexAddDiv');
    	var totalAmount = $('#totalAmount');
    	if(!isNotNull(indexAddDiv.text()))
    	{
    		showMsg('请填写至少一项费用。');
    		return;
    	}
    	if(parseFloat(totalAmount.val(), 10) <= 0)
    	{
    		showMsg('金额必须大于0。<br/><font color="red">提示：金额、开始日期与结束日期都不能为空。</font>');
    		return;
    	}
    	var url = 'inner/charge/addTuitionDetail.action';
    	ajaxAction(url, 'post', 'frm', true, function(result){
    		var returnObj = eval(result)[0];
        	if('success' == returnObj.result)
            {
    			getParentWin().searchThis();
    			window.close();
            }
        	else
        	{
        		showMsg(returnObj.message);
            }
    	});
    }
    </script>
  </body>
</html>
